def main():
    y_or_n = input("是否退出程序（退出请输入yes，否则输入no）？")
    while (y_or_n !=  "yes"):
        gender = input("性别：")
        weight = float(input("体重(kg):"))
        height = float(input("身高(cm):"))
        age = int(input("年龄："))

        if gender=="女":
            GMR = 661 + 9.6 * weight + 1.72 * height - 4.7 * age
        elif gender=="男":
            GMR = 67 + 13.73 * weight + 5 * height - 6.9 * age
        else:
            GMR = -1
        if GMR!=-1:
            print("基础代谢率（大卡）：",GMR)
        else:
            print("暂不支持该性别！")
        print()
        y_or_n = input("是否退出程序（退出请输入yes）？")


if __name__=="__main__":
    main()

